package com.red.star.wechat.data.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.Table;
import javax.persistence.Transient;
import java.math.BigDecimal;

/**
 * @author nofish.yan@gmail.com
 * @date 2018/6/28.
 * 收益明细表，支付与退款、提现
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Table(name = "t_income_detail")
public class IncomeDetail extends BaseEntity {

    /**
     * 收益汇总ID(转出时无值)
     */
    private Integer incomeId;

    /**
     * 收益明细类型： 0收入  1退款 2转出
     */
    private Integer type;

    /**
     * 金额
     */
    private BigDecimal money;

    /**
     * 当前交易发生后的余额
     */
    private BigDecimal amount;

    /**
     * 导购ID
     */
    private Integer employeeId;

    /**
     * 结算单ID(转出时有值)
     */
    private Integer settleId;

    /**
     * 蓄客卡名称
     */
    @Transient
    private String storedCardName;

    /**
     * 订单号
     */
    private String orderId;

    public IncomeDetail(Integer incomeId, Integer type, BigDecimal money, BigDecimal amount, Integer employeeId, String orderId) {
        this.incomeId = incomeId;
        this.type = type;
        this.money = money;
        this.amount = amount;
        this.employeeId = employeeId;
        this.orderId = orderId;
    }
}
